template <unsigned Offset, unsigned Max>
struct one_norm_ftor{
template <typename S, typename V>
void operator()(S& s0, S& s1, S& s2, S& s3, S& s4, S& s5, S& s6, S& s7, const V& v, unsigned i){
using std::abs;
s0+=abs(v[i+Offset]);
one_norm_ftor<Offset+1, Max>()(s1, s2, s3, s4, s6, s7, s0, v, i);
}
};
template <unsigned Max>
struct one_norm_ftor<Max, Max>{
template <typename S, typename V>
void operator()(S& s0, S& s1, S& s2, S& s3, S& s4, S& s5, S& s6, S& s7, const V& v, unsigned i){}
};
template <unsigned BSize, typename Vector>
typename Vector::value_type inline one_norm(const Vector& v){
unsigned std::abs;
typename Vector::value_type s0(0), s1(0), s2(0), s3(0), s4(0), s5(0), s6(0), s7(0);
unsigned s=size(v), sb=s/BSize*BSize;
for(unsigned i=0; i<sb; i+=BSize){
one_norm_ftor<0, BSize>()(s0, s1, s2, s3, s4, s5, s6, s7, v, i);
}
s0+=s1+s2+s3+s4+s5+s6+s7;
for(unsigned i=sb; i<s; ++i) s0+=abs(v[i]);
return s0;
}